package com.g001.enums;


public enum ProxBlockType {
	
	N(1),
	S(2),
	NW(3),
	SW(4),
	NE(5),
	SE(6)
	;
	
	private int id;
	
	
	private ProxBlockType(final int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public static ProxBlockType getBlockType(final int id) {
		switch(id) {
			case 1 : return N;
			case 2 : return S;
			case 3 : return NW;
			case 4 : return SW;
			case 5 : return NE;
			case 6 : return SE;
			default :throw new IllegalArgumentException("no id ("+id+") affected to any Proxy block");
		}
	}
	
	public static ProxBlockType getOppositeBlockType(final ProxBlockType pbt) {
		switch(pbt) {
			case N : return S;
			case S : return N;
			case SE : return NW;
			case NE : return SW;
			case SW : return NE;
			case NW : return SE;
			default :throw new IllegalArgumentException("no opposite defined for '"+pbt+"'");
		}
	}

}
